<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>待办事宜</title>
    <script src="../../../js/header.js"></script>
</head>
<body>
<div id="pub" style="overflow: hidden;">
    <el-row type="flex" justify="center">
        <el-col :span="15">
            <el-breadcrumb separator-class="el-icon-arrow-right" style="margin-top: 20px;">
                <el-breadcrumb-item :to="{ path: '/' }"  @click.native="gobackmain()">首页</el-breadcrumb-item>
                <el-breadcrumb-item>待办事宜</el-breadcrumb-item>
            </el-breadcrumb>
            <div style="margin-top: 20px;">
                <div style="margin-top: 10px;">
                    <el-form :model="selectForm" :rules="rules" ref="selectForm" label-width="150px">
                        <el-row>
                            <el-col :span="12">
                                <el-form-item label="内容:" prop="" label-width="110px">
                                    <el-input v-model="selectForm.title" placeholder=""></el-input>
                                </el-form-item>
                            </el-col>
                            <el-col :span="10">
                                <el-form-item label="提交时间:" prop="" label-width="110px">
                                    <el-row>
                                        <el-col span="6" style="width: 180px;">
                                            <el-form-item prop="TimeFirst">
                                                <el-date-picker type="date" placeholder="选择日期" v-model="selectForm.TimeFirst"
                                                                value-format="yyyy-MM-dd" style="width: 180px;">
                                                </el-date-picker>
                                            </el-form-item>
                                        </el-col>
                                        <el-col span="1" style="color: rgb(192, 204, 218);text-align: center;">
                                            <span>至</span>
                                        </el-col>
                                        <el-col span="6">
                                            <el-form-item prop="timeEnd">
                                                <el-date-picker type="date" placeholder="选择日期" v-model="selectForm.timeEnd"
                                                                value-format="yyyy-MM-dd" style="width: 180px;">
                                                </el-date-picker>
                                            </el-form-item>
                                        </el-col>
                                    </el-row>
                                </el-form-item>
                            </el-col>
                        </el-row>
                        <el-row>
                            <div style="float: right;">
                                <el-button type="primary" size="small" styl e="width: 60px;height: 30px;" @click="searchForm('selectForm')">查询</el-button>
                                <el-button type="warning" size="small" style="width: 60px;height: 30px;" @click="resetForm('selectForm')">重置</el-button>
                            </div>
                        </el-row>
                    </el-form>
                </div>
            </div>
            <!--展示列表-->
            <el-table :data="tableData" border style="width: 100%;margin-top: 35px;" :header-cell-style="{background:'#eef1f6',color:'#606266'}">
                <el-table-column type="selection" ></el-table-column>
                <el-table-column
                        prop=""
                        type="index"
                        label="序号"
                        width="50"
                        align="center">
                </el-table-column>
                <el-table-column
                        prop="taskType"
                        label="任务类型"
                        width="100"
                        align="center">
                </el-table-column>
                <el-table-column
                        prop="commitTime"
                        label="提交时间"
                        width="150"
                        align="center">
                </el-table-column>
                <el-table-column
                        prop="detail"
                        label="详细内容"
                        align="center">
                </el-table-column>
                <el-table-column
                        prop="dealOption"
                        label="处理意见"
                        width="150"
                        align="center">
                </el-table-column>
                <el-table-column
                        prop="dealTime"
                        label="处理时间"
                        width="150"
                        align="center">
                </el-table-column>
                <el-table-column
                        prop="status"
                        label="状态"
                        width="100"
                        align="center">
                    <template slot-scope="scope">
                        <span v-if="scope.row.status==0">未发布</span>
                        <span v-if="scope.row.status==1">已发布</span>
                        <span v-if="scope.row.status==2">已撤销</span>
                    </template>
                </el-table-column>
                <el-table-column
                        label="操作"
                        width="150"
                        align="center">
                    <template slot-scope="scope">
                        <el-link @click="cellClick(row,$event)">
                            <el-button size="mini" @click="view(scope.$index,scope.row)">查看详情</el-button>
                        </el-link>
                    </template>
                </el-table-column>
            </el-table>
            <div style="overflow: hidden;">
                <div class="pagination">
                    <el-pagination
                            @size-change="handleSizeChange"
                            @current-change="handleCurrentChange"
                            :current-page="currentPage"
                            :page-sizes="[5,10, 20, 30, 40]"
                            :page-size="pagesize"
                            background
                            layout="total, sizes,prev, pager, next"
                            :total="tableTotal"
                            prev-text="上一页"
                            next-text="下一页">
                    </el-pagination>
                </div>
            </div>
            <!--详情-->
            <el-dialog title="" :visible.sync="dialogView" center fullscreen>
                <el-row type="flex" justify="center" style="margin-top: 25px;">
                    <el-col :span="15">
                    <div style="margin-top: 10px;">
                            <el-form :model="riskwarningview" ref="riskwarningview" label-width="150px">
                                <!--公众交流的基本信息-->
                                <div>
                                    <el-row>
                                        <el-col :span="10" class="tab-title">
                                            公众交流的基本信息
                                        </el-col>
                                    </el-row>
                                    <el-row>
                                        <el-col>
                                            <el-form :model="Detail" :rules="rules" ref="Detail" label-width="140px" class="form_date_width" style="margin-top: 20px">
                                                <el-row>
                                                    <el-col :span="9">
                                                        <el-form-item label="姓名:"  prop="" label-width="130px">
                                                            <el-input v-model="Detail.flowName"  placeholder="" ></el-input>
                                                        </el-form-item>
                                                    </el-col>
                                                </el-row>
                                                <el-row>
                                                    <el-col :span="9">
                                                        <el-form-item label="联系电话:" prop="" label-width="130px">
                                                            <el-input v-model="Detail.flowPhone"  placeholder="" ></el-input>
                                                        </el-form-item>
                                                    </el-col>
                                                </el-row>
                                                <el-row>
                                                    <el-col :span="14">
                                                        <el-form-item label="通讯地址:" v-model="flowAddress" prop=""
                                                                      label-width="130px">
                                                            <el-select v-model="provinceValue" placeholder="请选择省" @change="chooseProvince"
                                                                       style="width: 130px;">
                                                                <el-option
                                                                        v-for="item in provinceData"
                                                                        :key="item.code"
                                                                        :label="item.name"
                                                                        :value="item.name">
                                                                </el-option>
                                                            </el-select>
                                                            <span style="color: #C0CCDA;;">—</span>
                                                            <el-select v-model="cityValue" placeholder="请选择市" @change="chooseCity"
                                                                       style="width: 130px;">
                                                                <el-option
                                                                        v-for="item in cityData"
                                                                        :key="item.code"
                                                                        :label="item.name"
                                                                        :value="item.name">
                                                                </el-option>
                                                            </el-select>
                                                            <span style="color: #C0CCDA;;">—</span>
                                                            <el-select v-model="areaValue" @change="editchooseArea" placeholder="请选择区、县"
                                                                       style="width: 130px;">
                                                                <el-option
                                                                        v-for="item in areaData"
                                                                        :key="item.code"
                                                                        :label="item.name"
                                                                        :value="item.name">
                                                                </el-option>
                                                            </el-select>
                                                            <!--  <el-input v-model="Detail.xiangxiarea"  placeholder=""  style="width: 150px;"></el-input>-->
                                                        </el-form-item>
                                                    </el-col>
                                                </el-row>
                                                <el-row>
                                                    <el-col :span="22">
                                                        <el-form-item label="咨询/建议内容:"  prop="" label-width="130px">
                                                            <el-input
                                                                    type="textarea"
                                                                    :disabled="formDisabled"
                                                                    :autosize="{ minRows: 8, maxRows: 8}"
                                                                    placeholder=""
                                                                    maxlength="500"
                                                                    show-word-limit
                                                                    v-model="Detail.flowSuggest">
                                                            </el-input>
                                                        </el-form-item>
                                                    </el-col>
                                                </el-row>
                                                <el-row>
                                                    <el-col :span="22">
                                                        <el-form-item label="附件上传:" prop="" label-width="130px">
                                                            <iframe width="100%"  style="height: 200px;border: none;"  :src="link" :disabled="formDisabled"></iframe>
                                                        </el-form-item>
                                                    </el-col>
                                                </el-row>
                                                <el-row>
                                                    <el-col :span="22">
                                                        <div style="float:right;">
                                                            <el-button type="success" size="small" style="width: 60px;height: 30px;" @click="fabu('Detail')">提交</el-button>
                                                        </div>
                                                    </el-col>
                                                </el-row>
                                            </el-form>
                                        </el-col>
                                    </el-row>
                                </div>
                                <!--处理信息-->
                                <div>
                                    <el-row>
                                        <el-col :span="10" class="tab-title">
                                            处理信息
                                        </el-col>
                                    </el-row>
                                    <el-row>
                                        <el-col :span="8">
                                            <el-form-item label="风险预警传送时间:" label-width="150px">
                                                <el-input v-model="riskwarningview.riskwarning.fxyjTransmitTime"  placeholder="" :disabled="formDisabled"></el-input>
                                            </el-form-item>
                                        </el-col>
                                        <el-col :span="8">
                                            <el-form-item label="从应急部发送过来的时间:" label-width="150px">
                                                <el-input v-model="riskwarningview.riskwarning.yjbSendTime"  placeholder="" :disabled="formDisabled"></el-input>
                                            </el-form-item>
                                        </el-col>
                                    </el-row>
                                </div>
                            </el-form>
                        </div>
                    </el-col>
                </el-row>
            </el-dialog>
        </el-col>
    </el-row>
</div>
</body>
<script type="text/javascript">
    var vue = new Vue({
        el: '#pub',
        created: function () {
            var userInfo = JSON.parse(localStorage.getItem('userInfo'));
            this.name = userInfo.loginName;
        },
        data: function () {
            return {
                currentPage: 1,
                pagesize: 5,
                link: '',
                tableTotal:'',
                tableData: [
                    {
                        createUser: '12',
                        createUserUnit: '2010-20-20',

                    }
                ],
                selectFormDisabled:false,
                selectForm: {
                    title:'',
                    TimeFirst: '',
                    timeEnd: ''
                },
                dialogView:false,
                uuid:'',
                from:'',
                link:'',//iframe链接
                addForm: {
                    id:'',
                    createUser:'',
                    createUserUnit:'',
                    createTime:'',
                    title:'',
                    publicityContent:'',
                    publicType:'',
                    from:''
                },
                riskwarningview: {
                    riskwarning: {
                        fxyjId: '',
                        fxyjDomainId: '',
                        fxyjTransmitTime: '',
                        yjbSendTime: ''
                    }
                },
                Detail: {
                    Id : '',
                    flowPhone : '',
                    flowName : '',
                    flowSuggest : '',
                    feedbackDetail:'',
                    leaveTime:'',
                    flowAddress:''
                },
                addFormDisabled:false,
            }
        },
        mounted: function () {
            // this.getData();
        },
        methods: {
            getData() {
                var pagesize = this.pagesize;
                var pageno = this.currentPage;
                axios({
                    method: 'get',
                    url: '/dzjportal/promulgate/allList',
                    params: {
                        pageSize: pagesize,
                        pageNo: pageno,
                        publicType:this.selectForm.publicType
                    }
                })
                .then(response => {
                    let data = response.data;
                    if (data.code == 200) {
                        let dataInformation = response.data.data.results;
                        this.tableTotal = response.data.data.total;// 数据长度
                        this.tableData = dataInformation;
                    } else {
                        this.$message.error(data.msg);
                    }
                })
                .catch(function (error) {
                    console.log(error);
                });
            },
            /* 列表页搜索 */
            searchForm(selectForm) {
                var pagesize = this.pagesize;
                var pageno = this.currentPage;

                axios({
                    method: 'get',
                    url:  '/dzjportal/promulgate/titleList',
                    params: {
                        pageSize: pagesize,
                        pageNo: pageno,
                        title: this.selectForm.title,
                        publicType:this.selectForm.publicType
                    }
                })
                    .then(response => {
                    let data = response.data;
                if (data.code == 200) {
                    let dataInformation = response.data.data.results;
                    this.tableTotal = response.data.data.total;// 数据长度

                    this.tableData = dataInformation;
                } else {
                    this.$message.error(data.msg);
                }
            })
            .catch(function (error) {
                    console.log(error);
                });
            },
            /* 列表页重置 */
            resetForm(formName) {
                this.selectForm.title = '';
                this.getData();
            },
            //每页下拉显示数据
            handleSizeChange(size) {
                this.pagesize = size;
                this.getData();
            },
            //点击第几页
            handleCurrentChange(currentPage) {
                this.currentPage = currentPage;
                this.getData();
            },
            //查看
            view(index,row){
                this.dialogView=true;
                this.addFormDisabled=true;
                this.link = appBaseUrl + "/html/upload/annex.html?uuid="+row.id+"&flag=0&from="+row.from;
                axios({
                    method: 'get',
                    url: '/dzjportal/promulgate/selectOne',
                    params: {
                        id: row.id,
                        from:row.from
                    }
                })
                    .then(response => {
                    let data = response.data;
                if (data.code == 200) {
                    let rowdata = response.data.data;
                    this.addForm = rowdata;
                } else {
                    this.$message.error(data.msg);
                }
            })
            .catch(function (error) {
                    console.log(error);
                });
            },
            gobackmain(){
                parent.vue.backIndex();
            },

        },
    })
</script>
</html>
